package hu.genius.view.old;

import hu.genius.CoreApplication;
import hu.genius.R;
import hu.genius.model.BasketManager;
import hu.genius.model.DBUtil;
import hu.genius.model.entity.Product;
import hu.genius.view.adapters.ProductItemAdapter;

import java.util.List;

import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.TextView;

public class Desserts extends ListActivity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.products);

		CoreApplication application = (CoreApplication) this.getApplication();
		BasketManager basketManager = application.getBasketManager();
		Log.i("zs", this.getClass().getName() + ": " + basketManager.toString());
		List<Product> products = DBUtil.listProductsByCategory(this, 10);

		TextView productsTextView = (TextView) findViewById(R.id.productsLabelTextView);
		productsTextView.setText(getText(R.string.products_label) + " - " + getString(R.string.desserts_text));
		
//		ListView productsListView = (ListView) findViewById(R.);
//		productsListView.setAdapter(new ProductItemAdapter(this, R.layout.list_black_text, products));
		this.setListAdapter(new ProductItemAdapter(this, R.layout.listview_product_item_layout, products));
//		ScrollView actionView = (ScrollView) findViewById(R.id.productsScrollView);
//		actionView.addView(ViewUtils.buildProductsView(this, products));
	}
	
}